<?php
class filterApi extends baseApi{

	//构成菜单
	public function hook_menu_category(){
        return array(
            0 => array('name'=>'多维分类','url'=>url('admin_category/index'),'sequence'=>1),
            );
    }

    public function hook_purview_admin()
    {
        return array(
            'admin_category'=>array(
                'name'=>'多维分类',
                'auth'=>array(
                	'list'=>'列表',
                    'add'=>'添加',
                    'edit'=>'编辑',
                    'del'=>'删除',
                ),
            ),
        );
    }

	//多维分类列表
	public function class_list(){
		return model('filter_category')->filter_category_list();
	}

	//关联内容
	public function relation($data){
		return model('filter_relation')->content_relation($data);
	}

	//删除关联内容
	public function del($aid){
		return model('filter_relation')->del_content_relation($aid);
	}

	//多维分类HTML条件数据
	public function category_filter($data){
		return model('category_filter')->filter_data($data['id'],$data['cid'],$data['app']);
	}

	//多维分类sql语句
	public function category_sql($id=null){
		return model('category_filter')->filter_sql($id);
	}
	
}